package gbench.appdemo.mall.erp.components;

import gbench.common.tree.LittleTree.IRecord;

public interface IEntity<S> {

    /**
     * 
     * @return
     */
    public String getName();

    /**
     * 
     * @return
     */
    public Integer getId();

    /**
     * @return the attributes
     */
    public IRecord getAttributes();
    
    /**
     * @return the attributes
     */
    public default IRecord attrs() {
        return this.getAttributes();
    }

    /**
     * @param attributes the attributes to set
     */
    public S setAttributes(final IRecord attributes);

    /**
     * 提取属性值
     * 
     * @param <T>
     * @param name         属性名
     * @param defaultValue 默认值
     * @return 属性值
     */
    public <T> T attr(final String name, T defaultValue);

}
